/*
package com.wtwd.campus.utils;


import com.alibaba.fastjson.JSONObject;
import com.wtwd.campus.model.DeviceVerify;
import com.wtwd.campus.vcom.entity.DeviceVerifyInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

*/
/**
 * @author mjy
 * @date 2022/07/06
 * @description
 *//*

public class YfgwUtils {

    private static final Logger logger = LoggerFactory.getLogger(YfgwUtils.class);

    private static String appSecret = "mAW***4sO ";

    private static String appId = "jwopfv1r4T";

    private static final String url = "https://gwapi.10646.cn/api/getDevice/V1/1Main/vV1.1";


    */
/**
     * 生出燕飞格物所需token
     *
     * @param
     * @param timestamp
     * @param transId
     * @return
     *//*

    public static String createToken(String timestamp, String transId) {
        String str = "app_id" + appId + "timestamp" + timestamp + "trans_id" + transId + appSecret;
        return Sm3Utils.encrypt(str).toLowerCase();
    }


    //获取设备验证所需数据

    public static String getDeviceVerifyInfo(DeviceVerifyInfo deviceVerifyInfo) {
        String data = JSONObject.toJSONString(deviceVerifyInfo);
        JSONObject jsonObject = JSONObject.parseObject(data);
        System.out.println(jsonObject.toJSONString());
        logger.info("获取联通设备信息信息 param={},post请求", jsonObject.toJSONString());
        String s = HttpclientUtil.httpPost(url, jsonObject);
        return s;
    }


    public static void main(String[] args) {
        DeviceVerifyInfo deviceVerifyInfo = new DeviceVerifyInfo();
        deviceVerifyInfo.setAppId(appId);
        deviceVerifyInfo.setTransId("123456");
        String date = DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss SSS");
        deviceVerifyInfo.setTimestamp(date);
        String token = createToken(date, "123456");
        System.out.println(token);
        deviceVerifyInfo.setToken(token);
        DeviceVerify deviceVerify = new DeviceVerify();
        deviceVerify.setDeviceKey("uc2UaL3yPuDe4lv");
        deviceVerify.setProductKey("cubo1w8s5fjrjYuQ");
        deviceVerifyInfo.setData(deviceVerify);
        String s = getDeviceVerifyInfo(deviceVerifyInfo);
        System.out.println(s);
    }

}
*/
